package com.sskj.market.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.market.bean.AddressBean;
import com.sskj.market.bean.GoodCategoryBean;
import com.sskj.market.ui.activity.GoodCategoryActivity;


/**
 * @author Hey
 * Create at  2019/07/31
 */
public class GoodCategoryPresenter extends BasePresenter<GoodCategoryActivity> {

    public void getGoodCategoryData(int page,int type,boolean flag) {
        httpService.getGoodCategoryData(page,type)
                .tag(this)
                .execute(new JsonCallBack<HttpData<GoodCategoryBean>>(flag?this:null) {
                    @Override
                    public void onSuccess(Response<HttpData<GoodCategoryBean>> response) {
                        mView.getGoodCategoryDataSuccess(response.body().getData());
                    }

                    @Override
                    public void onFinish() {
                        super.onFinish();
                        mView.getGoodRefreshSuccess();
                    }
                });
    }
}
